﻿using Abp.Domain.Repositories;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Yozeev.BusinessLogic;

namespace Yozeev.Controllers.Stats.Filters
{
    public class TicketTypeFilter: AbstractFilter
    {
        private readonly IRepository<Ticket, Guid> _ticketRep;
        public TicketTypeFilter(IRepository<Ticket, Guid> ticketRep)
        {
            _ticketRep = ticketRep;
        }

        public override void Decorate(Dictionary<string, IEnumerable<object>> Data)
        {
            if (Data.ContainsKey("Tickets")) return;
            var tickets = _ticketRep.GetAll();
            Data.Add("Tickets", tickets.ToList());
        }
    }
}
